package com.xian.im.common.properties;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: xian-notify-server
 * @description: 错误码
 * @author: liru.xian
 * @create: 2020-07-21 14:28
 **/
@Data
@Configuration
@ConfigurationProperties(prefix = "error")
public class IErrorCodeProperties {

    /**
     * 10000-19999 业务错误代码
     * 5XX 系统错误
     * 4XX
     */
    Map<String, String> errors = new HashMap<>();

    /***
     * 获取错误码信息
     * @param code
     * @return
     */
    public String getMesByCode(String code) {
        return errors.get(code);
    }
}
